package com.wxy.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.wxy.domain.MyExceptionHandle;

@Controller
public class exceptionController {
	@RequestMapping("ex1")
	@ResponseBody
	public int error1() {
		return 1/0;
	}
	@RequestMapping("ex2")
	@ResponseBody
	public int error2() {
		int n=0;
		if(n==0)
			throw new MyExceptionHandle("n==0,滚蛋...");
		return 1;
	}
}
